hvm pmtimer: correct pmtimer accuracy
authorKeir Fraser <keir.fraser@citrix.com>
Fri, 17 Sep 2010 15:59:21 +0000 (16:59 +0100)
committerKeir Fraser <keir.fraser@citrix.com>
Fri, 17 Sep 2010 15:59:21 +0000 (16:59 +0100)
commita541d50bffb48c13dd6776f3d75c189af8c24b3d
tree499ea3478381422288ea619d1575a9266dab15b4
parent453bfd468f1f1db8764b8f282c375852dc1c77ab
hvm pmtimer: correct pmtimer accuracy

Several seconds of backward time drift per minute can be seen on a
RHEL6 HVM guest by switching the clocksource to 'acpi_pm' and then
running gettimeofday() in a loop. This is due to the accumulation
of small inaccuracies that are caused by shifting out the lower 32
bits when pmt_update_time() computes 'tmr_val'.

The patch makes sure that the lower 32 bits of the computed value
are not lost. They are saved in a new field 'not_accounted' in the
PMTState structure and are accounted the next time pmt_update_time()
is called.

From: Ulrich Obergfell <uobergfe@redhat.com>
Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
xen/arch/x86/hvm/pmtimer.c
xen/include/asm-x86/hvm/vpt.h